import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
/** 配置 angular i18n **/
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';

// modules
import { AppRoutingModule } from './app-routing.module';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';


// services
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { HeroService } from './services/hero.service';
import { StorageService } from './services/storage.service';
import { UserTypeService } from './services/user-type.service';
import { AuthInterceptor } from "./services/interceptor.service";
import { LogoimgSyncService } from "./services/logoimg-async";

//components
import { AppComponent } from './app.component';
import { LoginComponent } from './pages/login/login.component';
import { RegisterComponent } from './pages/register/register.component';
// import { NOpage404Component } from './pages/nopage404/nopage404.component';
import { ForgetpwdComponent } from './pages/forgetpwd/forgetpwd.component';

registerLocaleData(zh);

@NgModule({
  declarations: [
    /*引入当前项目需要的 *组件* ，自定义的组件都需要在这里配置*/
    AppComponent,
    LoginComponent,
    RegisterComponent,
    // NOpage404Component,
    ForgetpwdComponent
  ],
  imports: [  /*当前项目依赖的 *模块* */
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
    AppRoutingModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule
  ],
  providers: [{provide: HTTP_INTERCEPTORS,useClass: AuthInterceptor, multi: true},{provide: LocationStrategy, useClass: HashLocationStrategy},HeroService,StorageService,UserTypeService, LogoimgSyncService,{ provide: NZ_I18N, useValue: zh_CN }],/*定义的 *服务* 放到这里*/ 
  bootstrap: [AppComponent] /*默认启动的组件*/
})
export class AppModule { }